from django.urls import path
from .views import (
    RegisterView,
    LoginView,
    UserInfoView,
    AvatarUploadView,
    ChangePasswordView,
    AdminUserListCreateView,
    AdminUserDetailView,
    AdminUserToggleStatusView,
    AdminUserResetPasswordView,
)

urlpatterns = [
    path('register/', RegisterView.as_view(), name='user_register'),
    path('login/', LoginView.as_view(), name='user_login'),
    path('user_info/', UserInfoView.as_view(), name='user_info'),
    path('avatar_upload/', AvatarUploadView.as_view(), name='avatar_upload'),
    path('change_password/', ChangePasswordView.as_view(), name='change_password'),
    # 用户管理（后台）
    path('admin/users/', AdminUserListCreateView.as_view(), name='admin_user_list_create'),
    path('admin/users/<int:user_id>/', AdminUserDetailView.as_view(), name='admin_user_detail'),
    path('admin/users/<int:user_id>/toggle_status/', AdminUserToggleStatusView.as_view(), name='admin_user_toggle_status'),
    path('admin/users/<int:user_id>/reset_password/', AdminUserResetPasswordView.as_view(), name='admin_user_reset_password'),
]
